import React from 'react';
export default class BodyIndex extends React.Component {

    constructor(){
        super(); //调用基类的所有的初始化方法
        this.state = {
            username : 'Parry'
        }
    }

    render() {
        setTimeout(()=>{
            //更改state的时候
            this.setState({
                username:'sky'
            });
        },3000);

        return (
            <div>
                <h3>这里是内容区.</h3>
                <p>{this.state.username} {this.props.userid} {this.props.username}</p>
            </div>
        )
    }
}